<?php
	function abreConec(){
		define ('SERVIDOR', 'localhost');
		define ('USUARIO', 'agenciaw_news3');
		define ('SENHA', 'senhas*2013');
		define ('BD', 'agenciaw_somateria3');
			
		$conn = mysql_connect(SERVIDOR,USUARIO,SENHA);
		if(!$conn){
			header ("Location: index.php?p=inicio&a=106");
			exit();
		}
		
		$selecdb = mysql_select_db(BD,$conn);
		if(!$selecdb){
			header ("Location: index.php?p=inicio&a=107");
			exit();	
		}
		mysql_query("SET NAMES 'utf8'");
		mysql_query('SET character_set_connection=utf8');
		mysql_query('SET character_set_client=utf8');
		mysql_query('SET character_set_results=utf8');
	}
?>